package com.DongBing;

import com.aliyun.oss.OSSClient;
import lombok.val;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import javax.annotation.Resource;
import java.io.FileInputStream;
import java.io.FileNotFoundException;

@SpringBootTest
public class SpringBootTestPlus {

    @Resource
    private OSSClient ossClient;

    @Test
    void Test001(){
        String filePath= "D:\\x.jpg";
        try {
            val stream = new FileInputStream(filePath);
            ossClient.putObject("dong-bing-life","dong-bing-001.jpg",stream);
            ossClient.shutdown();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }

}
